import { useRoleStore } from "@/store/modules/useRoleStore";
import { RouteRecordRaw } from 'vue-router';
import { createPinia } from 'pinia';
import { storeToRefs } from "pinia";

// 手动创建 Pinia 实例
const pinia = createPinia();

// 使用 store
const roleStore = useRoleStore(pinia);

const { role } = storeToRefs(roleStore);
// console.log(role.value);
// const adminRoutes: RouteRecordRaw[] = [
//   {
//   path: "/admin",
//   redirect: "/admin/index",
//   meta: {
//     icon: "material-symbols:book-ribbon",
//     title: "管理员信息",
//     // showLink: role.value == '0' ? true : false,
//     roles: ['0'],
//     rank: 12
//   },
//   children: [
//     {
//       path: "/admin/index",
//       name: "Admin",
//       component: () => import("@/views/admin/index.vue"),
//       meta: {
//         title: "管理员信息"
//       }
//     },
    
//   ]
// }
// ]
// export default adminRoutes

export default {
  path: "/admin",
  redirect: "/admin/index",
  meta: {
    icon: "material-symbols:book-ribbon",
    title: "管理员信息",
    // showLink: role.value == '0' ? true : false,
    roles: ['0'],
    rank: 12
  },
  children: [
    {
      path: "/admin/index",
      name: "Admin",
      component: () => import("@/views/admin/index.vue"),
      meta: {
        title: "管理员信息"
      }
    },
    
  ]
} as RouteConfigsTable;